<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/oversea.js"></script>
<title>运输任务｜海外仓管理</title>
<script >
    function changstatus(t,id,type,flag=1){
        if(flag==1){


        }
        if(confirm("你确定执行此操作?"))
        {
            $.post("/oversea/ajaxbutton", {"op": "changstatus","t":t,"id":id,"type":type},
                    function(data){
                        if(type==1)
                        {
                            if(t>=4)
                            {
                                window.location.href="/oversea/deliveryplanlist";
                            }else{
                                window.location.href = "/oversea/purchasinglist";
                            }
                        }else{
                            window.location.href = "/oversea/transportlist";
                        }
                        return;
                    },"json");

        }
    }
    function submitOrderBatch() {
        $('#flagtype').val(1);
        $("#search").submit();
        $('#flagtype').val(0);
    }
</script>
<body class="withvernav">
<div class="bodywrapper">
{{include file='/public/leftmenu.tpl'}}
<div class="centercontent tables">
  <div class="pageheader notab">
    <h1 class="pagetitle">运输任务</h1>
    <span class="pagedesc"></span>
            <div class="menulist">
        		<ul class="profile_summary">
                    </ul>
               </div> </div>
  <!--pageheader-->
    <div style="float:left">
        {{if $managers || $userdepartment == 2}}
            <button type="button" class="btn btn-primary "  onclick="submitOrderBatch(2)">导出excel</button>
        {{/if}}
    </div>
  <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
  <div id="contentwrapper" class="contentwrapper"> 
    <!--搜索栏-->
    <form class="stdform stdform2" method="get" action="/oversea/transportlist" id="search">
      <div class="tableoptions"> 操作时间：
        <input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
         <select name="st" class="selection" style="width:100px;" onChange="changother()">
            <option value="1" {{if $st=="1"}} selected{{/if}}>任务编号</option>
            <option value="2" {{if $st==2}} selected{{/if}}>商品编号</option>
            <option value="3" {{if $st==3}} selected{{/if}}>物流编号</option>
            
             </select>: <input type="text" name="other" id="other" class="width100" value="{{$other}}" />
             &nbsp;
              状态:
            <select name="status" class="selection" style="width:100px;">
            <option value=""  selected>请选择</option>
            <option value="1" {{if $status==1}} selected{{/if}}>新创建</option>
            <option value="2" {{if $status==2}} selected{{/if}}>已发运</option>
              <option value="5" {{if $status==5}} selected{{/if}}>运输完成</option>
            </select>
&nbsp;
承运人
<select class="selection" id="carriername" name="carrier">
                <option value="">--请选择--</option>
                
						     	 {{foreach from=$carrierlist item=li key=key}}
					    			
                <option value="{{$li}}" {{if $carrier==$li}} selected{{/if}}>{{$li}}</option>
                
					  	     	{{/foreach}}
					    			
					  	     	
							
              </select>
        &nbsp;
         始发地
          <select name="starthouse" id="starthouse" class="selection select2_group" style="width:200px;">
                            	 <option value="" >请选择</option>
                               {{foreach from=$overseawarehouse item=li key=key}}
                               		 <option value="{{$li.name}}" {{if $li.name==$starthouse}} selected{{/if}}  >{{$li.name}}</option>
                               {{/foreach}}
                            </select>
                          
                           
                &nbsp;
        目的地：
          <select name="endhouse" id="endhouse" class="selection select2_group" style="width:200px;">
                            	 <option value="" >请选择</option>
                               {{foreach from=$overseawarehouse item=li key=key}}
                               		{{if $myseawarehouse}}
                               		  {{if in_array($li.name,$myseawarehouse)}} 
                               			 <option value="{{$li.name}}" {{if $endhouse==$li.name}} selected{{/if}} >{{$li.name}}</option>
                                	  {{/if}}
                                    {{else}}
                               			 <option value="{{$li.name}}"{{if $endhouse==$li.name}} selected{{/if}} >{{$li.name}}</option>
                                    {{/if}}
                               {{/foreach}}
                            </select>
                             &nbsp;
        店 铺:
         <select name="shopname" id="shopname"  class="selection select2_group" style="width:200px;">
                             <option value="" >请选择</option>
                               {{foreach from=$d_shop item=li key=key}}
                              	 {{if $myshopname}}
                                     {{if in_array($li.name,$myshopname)}} 
                                     <option value="{{$li.name}}" {{if $shopname==$li.name}} selected{{/if}} >{{$li.name}}</option>
                                     {{/if}}
                                 {{else}}
                                 	  <option value="{{$li.name}}" {{if $shopname==$li.name}} selected{{/if}} >{{$li.name}}</option>
                                 {{/if}}
                               {{/foreach}}
                            </select>              
                           
        &nbsp;
          <input type="hidden" id="flagtype" name="flagtype" value="">
        <button class="radius3">Search</button>
        
      </div>
    </form>
    <!--搜索栏结束-->
    <div class="x_content" style="overflow-x:auto;">
    <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
      <colgroup>
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      <col class="con0" />
      <col class="con1" />
      </colgroup>
      <thead>
        <tr>
          <th class="head0">任务编号</th>
          <th class="head0">状态</th>
          <th class="head0">始发地</th>
          <th class="head1">目的地</th>
          <th class="head0">承运人</th>
           <th class="head0">店铺</th>
          <th class="head0">备货日期</th>
          <th class="head0">发货日期</th>
          <th class="head0">SKU数</th>
          <th class="head0">总数量</th>
            <th class="head0">运费</th>
          <th class="head0">总成本</th>
          <th class="head0">经办人</th>
          	 <th class="head0">操作</th>
          
        </tr>
      </thead>
      <tbody>
      
      {{foreach from=$list item=li key=key}}
      <tr>
        <td>{{$li.tasknumber}}</td>
        <td>
        {{if $li.status==1}}新创建{{/if}}
        {{if $li.status==2}}已发运{{/if}}
        {{if $li.status==5}}运输完成{{/if}}
        </td>
        <td>{{$li.startingplace}}</td>
        <td>{{$li.destination}}</td>
        <td>{{$li.carrier}}</td>
         <td>{{$li.shopname}}</td>
        <td>{{$li.beiprojectdate}}</td>
         <td>{{$li.projectdate}}</td>
        <td class="center">{{$li.skunum}}</td>
        <td class="center">{{$li.totalnum}}</td>
          <td class="center">
              {{if $li.actual_freight}}
                    <a href="javascript:void(0);" title="真实运费" style="color:red;">{{$li.actual_freight}}</a>
              {{else}}
                    <a href="javascript:void(0);" title="预估运费">{{$li.freight}}</a>
              {{/if}}
          </td>
        <td class="center">{{$li.total}}</td>
        <td class="center">{{$li.createoper}}</td>
         <td class="center"><a href="/oversea/showtask/{{$li.id}}" target="_blank"> 查看</a>
         
         {{if $li.status !=5 && ($li.mod==1 ||  $department==2 ||  $department==1)}}
          |<a href="javascript:void(0)" onClick="do_qa({{$li.id}})"> 运输状态</a> |
             <!-- 3 4 6 9 -->
             {{if in_array($li.oversea_destinationId,$arr_oversea)}}
                <a href="/oversea/ajaxbutton?op=showSureEnd&&id={{$li.id}}&oversea_startId={{$li.oversea_startId}}&&oversea_destinationId={{$li.oversea_destinationId}} " target="_blank">确认完成</a>
             {{else}}
                <a href="javascript:void(0)" onClick="changstatus(5,{{$li.id}},2)">确认完成</a>
             {{/if}}
             <!--
             <a href="javascript:void(0)" onClick="changstatus(5,{{$li.id}},2)">确认完成</a>
             -->
       {{/if}}
       
       	{{if ($li.status ==1 && $li.mod==1) || ($li.tstatus==1 && $department ==1) || ($li.tstatus==1 && $department ==2)}}
        <!--| <a href="javascript:void(0)" onClick="deltask({{$li.id}})">｜撤销</a>-->
        {{/if}}
        
        
       
        
        
       </td>
      </tr>
      {{/foreach}}
        </tbody>
      
    </table>
    </div>
    <div class="page">{{$pageList}}</div>
    <br />
    <br />
  </div>
</div>
<!--bodywrapper-->
<!--bodywrapper-->
<!-- 模态框（Modal） -->
 <form action="/oversea/ajaxbutton?op=savefuyi"  method="post" name="qaform" id="qaform"  enctype="multipart/form-data" >
 <input type="hidden" id="id" name="ClentID">
 <input type="hidden" id="sfexpress" name="sfexpress" value="{{$sfexpress}}">
 <input type="hidden" id="upsexpress" name="upsexpress" value="{{$upsexpress}}">
 <input type="hidden" id="dhlexpress" name="dhlexpress" value="{{$dhlexpress}}">
 <input type="hidden" id="FedExexpress" name="FedExexpress" value="{{$FedExexpress}}">
 <input type="hidden" id="jiachenexpress" name="jiachenexpress" value="{{$jiachenexpress}}">
 <div class="modal fade" id="returndataModal" tabindex="-1" role="dialog" aria-labelledby="returnModalLabel" aria-hidden="true">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">×
            </button>
            <h4 class="modal-title" id="returnModalLabel">
               填写运输相关
            </h4>
         </div>
         <div class="modal-body">
         
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr >
            <th>承运人
              </th>
            <td align="left"><select class="selection" id="carrier" name="carrier" onBlur="getpriceexpress()">
                <option value="">--请选择--</option>
                
						     	 {{foreach from=$carrierlist item=li key=key}}
					    			
                <option value="{{$li}}" {{if $detail.carrier==$li}} selected{{/if}}>{{$li}}</option>
                
					  	     	{{/foreach}}
					    			
					  	     	
							
              </select></td>
          </tr>
          <tr>
            <th>运输方式
              </th>
            <td  height="25"><select class="selection" id="transportmode" name="transportmode"  style="width:200px;">
                <option value="">-请选择-</option>
                
						    	 {{foreach from=$transportmodelist item=li key=key}}
					    			
                <option value="{{$li}}" {{if $detail.transportmode==$li}} selected{{/if}}>{{$li}}</option>
                
					  	     	{{/foreach}}
									
              </select>
             </td>
          </tr>
          <tr>
            <th>发货时间
              </th>
            <td align="left"><input type="text"  name="projectdate" id="projectdate" value="{{$detail.projectdate}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /></td>
          </tr>
          <tr>
            <th>到货时间
              </th>
            <td align="left"><input type="text"  name="endprojectdate" id="endprojectdate" value="{{$detail.endprojectdate}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /></td>
          </tr>
           <tr>
            <th>重量
              </th>
            <td align="left"><input type="text" class="width100" id="weight"  name="weight" onKeyUp="value=value.replace(/[^\d.]/g,'')" value="" onBlur="getpriceexpress()"  /> KG 
            </td>
          </tr>
        
          
           <tr>
            <th>提货进仓费
              </th>
            <td align="left"><input type="text" class="width100" id="delivery_fee" onKeyUp="value=value.replace(/[^\d.]/g,'')"  name="delivery_fee" value=""  />
             </td>
          </tr>
          
          <tr>
            <th>报关费
              </th>
            <td align="left"><input type="text" class="width100" id="clearance_fee" onKeyUp="value=value.replace(/[^\d.]/g,'')"  name="clearance_fee" value=""  />
             </td>
          </tr>
            <tr>
            <th>运费
              </th>
            <td align="left"><input type="text" class="width100" id="freight" onKeyUp="value=value.replace(/[^\d.]/g,'')"  name="freight" value=""  />
              运费说明：
              <input type="text" class="width100" id="projectdateremake"   name="projectdateremake" value=" "  /></td>
          </tr>
          <tr>
            <th>关税
              </th>
            <td align="left"><input type="text" class="width100" id="tariffs_fee" onKeyUp="value=value.replace(/[^\d.]/g,'')"  name="tariffs_fee" value=""  />
             </td>
          </tr>
           <tr>
            <th>其他费用
              </th>
            <td align="left"><input type="text" class="width100" id="other_fee" onKeyUp="value=value.replace(/[^\d.]/g,'')"  name="other_fee" value=""  />
             </td>
          </tr>
          
          <tr>
            <th>参考号
              </td>
            <td align="left"><input type="text" class="width200" id="ck" onKeyUp="value=value.replace(/[^0-9a-zA-Z]/g,'')"    name="ck" value=""  /></td>
          </tr>
          <tr>
            <th>备注
              </th>
            <td align="left"><textarea name="cargostatus" id="cargostatus" cols="5" rows="5">{{$detail.cargostatus}}</textarea></td>
          </tr>
        </table>
        
         <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal">
               关闭
            </button>
            <button type="button" class="btn btn-primary"  onclick="doqa()">
               提交
            </button>
         </div>
         </div>
      </div><!-- /.modal-content -->
   </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</form>

</body>
</html>